//
//  HelloWorldLayer.m
//  PockerIn
//
//  Created by sunrui-MacBook on 11-7-13.
//  Copyright 139.ME 2011. All rights reserved.
//

// Import the interfaces
#import "HelloWorldScene.h"

// HelloWorld implementation


@implementation HelloWorld

+(id) scene
{
	// 'scene' is an autorelease object.
	CCScene *scene = [CCScene node];
	
	// 'layer' is an autorelease object.
	HelloWorld *layer = [HelloWorld node];
	
	// add layer as a child to scene
	[scene addChild: layer];
	
	// return the scene
	return scene;
}

// on "init" you need to initialize your instance
-(id) init
{
	// always call "super" init
	// Apple recommends to re-assign "self" with the "super" return value
	if( (self=[super init] )) {

		//添加背景
		CGSize size = [[CCDirector sharedDirector] winSize];

		CCSprite * background;
		if (FBIsDeviceIPad()) {
			background = [CCSprite spriteWithFile:@"HallBackground_iPad.png"];
		}
		else {
			background =[CCSprite spriteWithFile:@"desk_background.jpg"];
		}

		background.position = ccp(size.width/2,size.height/2);	
		[self addChild: background];
//		
//		loadingStatus = [CCLabelTTF labelWithString:@"Connecting" fontName:@"MarkerFelt-Wide" fontSize:FBIsDeviceIPad()?32:22];
//		loadingStatus.anchorPoint = ccp(1,1);
//		loadingStatus.position = ccp(size.width/1.2,size.height/10);
//		[self addChild:loadingStatus];
	}
	return self;
}

// on "dealloc" you need to release all your retained objects
- (void) dealloc
{
	// in case you have something to dealloc, do it in this method
	// in this particular example nothing needs to be released.
	// cocos2d will automatically release all the children (Label)
	
	// don't forget to call "super dealloc"
	[self removeAllChildrenWithCleanup:YES];
	
	[super dealloc];
}
@end





/*动画
 //		CCTexture2D *tex = [[CCTextureCache sharedTextureCache] addImage:@"clock.png"];
 //		CCSpriteBatchNode *batch;
 //		batch = [FrameAnimHelper animWithTexture:tex
 //									   numFrames:73
 //								   plistFilename:@"clock.plist"
 //									  spriteName:@"clock"
 //									   spriteTag:1];
 //		batch.position = ccp(size.width/2,size.height/2);
 //		
 //		[self addChild:batch];
 */
